package com.wyc.price.controller;

import com.wyc.internalCommon.request.DirectionDTO;
import com.wyc.internalCommon.request.ForecastPriceDTO;
import com.wyc.internalCommon.response.ForecastPriceResponse;
import com.wyc.internalCommon.result.ApiResult;
import com.wyc.price.service.ForecastPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ForecastPriceController {

    @Autowired
    private ForecastPriceService forecastPriceService;

    /**
     * 计算预估价格
     * @return
     */
    @PostMapping("/forecast-price")
    public ApiResult<ForecastPriceResponse> forecastPrice(@RequestBody ForecastPriceDTO forecastPriceDTO){
        return forecastPriceService.forecastPrice(forecastPriceDTO);
    }

    /**
     * 计算实际价格
     * @param directionDTO
     * @return
     */
    @PostMapping("/calulate-price")
    public ApiResult calulatePrice(@RequestBody DirectionDTO directionDTO){
        return forecastPriceService.calulatePrice(directionDTO);
    }

}
